// =================================================================================================
//
//	CopyEngine Framework
//	Copyright 2012 Eran. All Rights Reserved.
//
//	This program is free software. You can redistribute and/or modify it
//	in accordance with the terms of the accompanying license agreement.
//
// =================================================================================================

/**
 * Created by eran on 14-12-21.
 */
package gui.component.mapEditor.cursor
{
    import flash.display.Shape;
    import flash.display.Sprite;

    public class MapEditorCursor
    {
        private var mCursorShape:Shape;

        public function MapEditorCursor()
        {
        }

        //=================================//
        //=== Initialize & Dispose ========//
        //=================================//

        public function initialize():void
        {
            mCursorShape = new Shape();
            mCursorShape.graphics.lineStyle(3, MapEditorConfig.BLOCK_CURSOR_COLOR);
            mCursorShape.graphics.moveTo(0, 0);
            mCursorShape.graphics.lineTo(MapEditorConfig.EACH_BLOCK_SIZE, 0);
            mCursorShape.graphics.lineTo(MapEditorConfig.EACH_BLOCK_SIZE, MapEditorConfig.EACH_BLOCK_SIZE);
            mCursorShape.graphics.lineTo(0, MapEditorConfig.EACH_BLOCK_SIZE);
            mCursorShape.graphics.lineTo(0, 0);
        }

        //=================================//
        //====== Public Function ==========//
        //=================================//

        public function get container():Shape {return mCursorShape;}

        public function moveCursorTo(_xTileNum:int, _yTileNum:int):void
        {
            mCursorShape.x = _xTileNum * MapEditorConfig.EACH_BLOCK_SIZE;
            mCursorShape.y = _yTileNum * MapEditorConfig.EACH_BLOCK_SIZE;
        }


    }
}
